<?php defined('KX_ROOT') || exit('Permission denied');?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title><?php include \Kuxin\View::parseTpl($tkd['title']);?></title>
    <meta name="keywords" content="<?php include \Kuxin\View::parseTpl($tkd['keywords']);?>">
    <meta name="description" content="<?php include \Kuxin\View::parseTpl($tkd['description']);?>">
	<link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/css/global.css"/>
	<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/flexible.min.js"></script>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
    <meta name="applicable-device" content="pc">
    <meta http-equiv="mobile-agent" content="format=html5; url=<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "mobileurl");?><?php echo $_SERVER['REQUEST_URI'];?>">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="Cache-Control" content="no-transform" />
    <link rel="canonical" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "pcurl");?><?php echo $_SERVER['REQUEST_URI'];?>" />
</head>
<body class="bg-f27">
	<div class="relative w100  bg-white flex-wrp flex-align-center flex-between lh100 plr15 ptb15">
        <?php if($_GET['subscribe']):?>
        <span class="color32 bold size16 select-all">全选</span>
        <div class="size16 bold color37"><?php echo $novel['name'];?></div>
        <span class="pt-return" style="width:.32rem">取消</span>
        <?php else:?>
        <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/return.png" class="pt-return">
        <div class="size18 bold color37"><?php echo $novel['name'];?></div>
        <div>
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/ellipsis.png" class="mr5 pt-ellipsis">
        </div>
        <div class="pt5 pb5 pt-tip">
            <a href="<?php echo \Kuxin\Helper\Url::build("novel.novel.index",['novelid'=>$novel['id'],'pinyin'=>$novel['pinyin']],"");?>" class="block color1 text-center pt-tip-item" title="<?php echo $novel['name'];?>">回到书页</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("index.index",[],"");?>" class="block color1 text-center pt-tip-item" title="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>">前往首页</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("novel.search.index",[],"");?>" class="block color1 text-center pt-tip-item">搜索小说</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.mark.index",[],"");?>" class="block color1 text-center pt-tip-item" rel="nofollow">我的书架</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("user.index.index",[],"");?>" class="block color1 text-center pt-tip-item" rel="nofollow">个人中心</a>
        </div>
        <?php endif;?>
	</div>
    <style>

    </style>
	<!-- 内容 -->
    <?php $charge=\Kuxin\Block::show('novel.charge', ['novelid'=>$novel['id']]);?>
    <?php  $charge = $userinfo['vip_expire_time'] < time()?$charge['words_money']:$charge['words_vip_money'];?>
    <div class="bg-white plr15 <?php echo $_GET['subscribe']?'subscribe':'';?>" data-words_money="<?php echo $charge;?>">
		<div class="w100 ptb10 border-b size14 color4">
            <span class="mr10 inline-block" style="height:.25rem;line-height:.25rem"><?php echo \Kuxin\View::default($novel['is_over'],"连载中",'已完结');?></span>
            <?php if(!$_GET['subscribe']):?><span class="inline-block" style="height:.25rem;line-height:.25rem"> 共<?php echo $last['id'];?>章</span><?php endif;?>
            <div class="fr inline-block">
                <?php if($sort=='desc'):?>
                <a class="flex-wrp flex-center pt-antitone" href="<?php echo \Kuxin\Helper\Url::build("novel.novel.dir",['novelid'=>$novel['id'],'pinyin'=>$novel['pinyin'],'sort'=>'asc','subscribe'=>$_GET['subscribe']],"");?>">
                    <span class="size14 color2">倒序</span>
                </a>
                <?php else:?>
                <a class="flex-wrp flex-center pt-antitone" href="<?php echo \Kuxin\Helper\Url::build("novel.novel.dir",['novelid'=>$novel['id'],'pinyin'=>$novel['pinyin'],'sort'=>'desc','subscribe'=>$_GET['subscribe']],"");?>">
                    <span class="size14 color2">正序</span>
                </a>
                <?php endif;?>
            </div>
        </div>
        <?php $list=\Kuxin\Block::show('chapter.list', ['novelid'=>$novel['id'],'page'=>$paginate['current'],'sort'=>$sort]);?>
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <?php if($_GET['subscribe']):?>
            <?php  if($loop['type']!=\App\Model\Novel\Chapter::TYPE_TOLL)continue;;?>
            <?php  if($novel['type'] == App\Model\Novel\Novel::TYPE_VIP_FREE && $userinfo['vip_expire_time'] > time())continue;;?>
            <?php $issubscribe=\Kuxin\Block::show('chapter.issubscribe', ['userid'=>$userinfo['id'],'novelid'=>$novel['id'],'chapterid'=>$loop['chapterid']]);?>
            <?php  if($issubscribe)continue;;?>
        <?php endif;?>
        <?php $price=\Kuxin\Block::show('chapter.calculatepricebyprice', ['wordsnum'=>$loop['words'],'price'=>$charge]);?>
        <div class="border-b chapter-list">
            <input type="checkbox" value="<?php echo $loop['chapterid'];?>" data-price="<?php echo $price;?>" id="chapter_<?php echo $loop['chapterid'];?>">
            <label class="pl30" for="chapter_<?php echo $loop['chapterid'];?>">
                <a title="<?php echo $loop['name'];?>" class="w100 flex-wrp flex-align-center flex-between pt10 pb10" <?php if(!$_GET['subscribe']):?> href="<?php echo \Kuxin\Helper\Url::build("novel.chapter.read",['novelid'=>$novel['id'],'pinyin'=>$novel['pinyin'],'chapterid'=>$loop['chapterid']],"");?>"<?php endif;?>>
                    <div class="flex-wrp"><span class="mr15 size12 color62"><?php echo $loop['name'];?></span></div>
                    <?php if($novel['type'] == App\Model\Novel\Novel::TYPE_TOLL || $novel['type'] == App\Model\Novel\Novel::TYPE_VIP_FREE && $userinfo['vip_expire_time'] < time()):?>
                        <?php if($loop['type'] == App\Model\Novel\Chapter::TYPE_TOLL):?>
                            <?php $issubscribe=\Kuxin\Block::show('chapter.issubscribe', ['userid'=>$userinfo['id'],'novelid'=>$novel['id'],'chapterid'=>$loop['chapterid']]);?>
                            <?php if(!$issubscribe):?>
                            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/icon_lock.png" class="pt-arrow-right">
                            <?php endif;?>
                        <?php endif;?>
                    <?php elseif($novel['type'] == App\Model\Novel\Novel::TYPE_VIP_FREE && $userinfo['vip_expire_time'] > time()):?>
                        <span class="size12">会员免费</span>
                    <?php endif;?>
                    <span class="pt-arrow-right size12"><?php echo $price;?><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></span>
                </a>
            </label>
		</div>
        <?php endforeach; endif;?>
        <?php if($_GET['subscribe']):?>
        <div class="bottom bg-white w100">
            <div class="fl pt10 pl20">
                <div class="color32 size14">已选择 <span class="selected_num">0</span> 章/<span class="selected_money">0</span><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></div>
                <div class="size12">当前余额 <span class="color2 total"><?php echo $userinfo['assets']['balance']?:0;?></span> 金币</div>
            </div>
            <button class="color1 bg-red fr ptb10 plr25 mt15 mb15 mr15">立即订阅</button>
        </div>
        <?php endif;?>
	</div>
    <!-- 底部版权 -->
    <div class="pt-copyright">
    <div class="size12  w100 text-center mt15 mb10"><a title="隐私声明" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'privacy'],"");?>" class="color4">隐私声明</a> | <a title="免责声明" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'disdaimer'],"");?>" class="color4">免责声明</a> | <a title="关于我们" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'about'],"");?>" class="color4">关于我们</a></div>
    <div class="size12 color4 w100 text-center mb10">Copyright © 2009-<?php echo date(Y);?> <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "beian");?></div>
    <div class="size12  w100 text-center"><?php echo \Kuxin\Response::runinfo();?></div>
</div>
<!-- js -->
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/jquery-3.3.1.js"></script>
<script>
    $('.pt-return,.pt-recall').click(function(){
        window.history.back();
    });
    $('.pt-ellipsis').click(function(){
        $('.pt-tip').toggle()
    });
    $('.pt-tip .pt-tip-item').click(function(){
        $('.pt-tip').toggle()
    });
</script>
<div class="none">
    <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "tongji.mobile");?>
    <?php if(\Kuxin\Helper\Arr::getValue($_kxcms_config, "app.use_cdn")):?>
    <script src="/api/stat/novel/info.js"></script>
    <script src="/api/stat/novel/read.js"></script>
    <?php endif;?>
</div>
    <script>var __NOVEL_ID = '<?php echo $novel['id'];?>', __RECHARGE_URL = '<?php echo \Kuxin\Helper\Url::build("user.pay.recharge",[],"");?>',__SUBSCRIBE_URL = '<?php echo \Kuxin\Helper\Url::build("novel.novel.subscribe",[],"");?>';</script>
    <script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/layer/mobile/layer.js"></script>
    <script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/dir.js"></script>
</body>
</html>